#include <iostream>

int add(int a, int b) { return a + b; }

int add_ref(const int &a, const int &b) { return a + b; }

int add_ptr(int *a, int *b) { return *a + *b; }

int main() {
  int a = 10, b = 20;
  int &ref_a = a;
  int &ref_b = b;
  int *ptr_a = &a, *ptr_b = &b;
  std::cout << "add(10, 20) = " << add(10, 20) << std::endl;
  std::cout << "add(a, b) = " << add(a, b) << std::endl;
  std::cout << "add_ref(ref_a, ref_b) = " << add_ref(ref_a, ref_b) << std::endl;
  std::cout << "add_ptr(&a, &b) = " << add_ptr(&a, &b) << std::endl;
  std::cout << "add_ptr(ptr_a, ptr_b) = " << add_ptr(ptr_a, ptr_b) << std::endl;
  delete ptr_a, ptr_b;

  auto ptr = new int(100);
  std::cout << "ptr = " << *ptr << std::endl;
  delete ptr;
  return 0;
}